package com.enterpriseDigitalPlatform.controller.renshi.jobLevel;

import com.enterpriseDigitalPlatform.controller.renshi.staff.Staff;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class JobLevelDao {
    private final JdbcTemplate jdbcTemplate;

    @Autowired
    public JobLevelDao(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }

    public List<JobLevel> getList() {
        return jdbcTemplate.query("select * from renshi_job_level", new BeanPropertyRowMapper<>(JobLevel.class));
    }
}
